home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue10.arc
/
DVAPI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-08-13
|
4KB
|
146 lines
/*=======================================================*/
/* DVAPI.C */
/* miscellaneous DESQview API functions that don't */
/* require MASM to recompile */
/* */
/* (c) Copyright 1988 Ralf Brown All Rights Reserved */
/* May be freely copied for noncommercial use, so long */
/* as this copyright notice remains intact, and any */
/* changes are marked in the comment blocks preceding */
/* functions. */
/*=======================================================*/
#include <string.h>
#include "tvapi.h"
/*======================================================*/
/* DVprogname--return offset of program's name in */
/* DESQVIEW.DVO */
/* Ralf Brown 4/2/88 */
/*======================================================*/
WORD pascal DVprogname(void)
{
#ifdef __TURBOC__
_AX = 0xDE00 ;
geninterrupt(0x15) ;
return _AX ;
#else
union REGS regs ;
regs.x.ax = 0xDE00 ;
int86(0x15,®s,®s) ;
return regs.x.ax ;
#endif __TURBOC__
}
/*======================================================*/
/* DVappnum--return application's number as it appears */
/* on the "Switch Window" menu */
/* Ralf Brown 4/3/88 */
/*======================================================*/
int pascal DVappnum(void)
{
#ifdef __TURBOC__
_AX = 0xDE07 ;
geninterrupt(0x15) ;
return _AX ;
#else
union REGS regs ;
regs.x.ax = 0xDE07 ;
int86(0x15,®s,®s) ;
return regs.x.ax ;
#endif __TURBOC__
}
/*======================================================*/
/* DVdbgpoke--poke a character directly into screen mem */
/* on the bottom line */
/* Ralf Brown 4/3/88 */
/*======================================================*/
void pascal DVdbgpoke(char c)
{
#ifdef __TURBOC__
_BL = c ;
_AX = 0xDE0A ;
geninterrupt(0x15) ;
#else
union REGS regs ;
regs.x.ax = 0xDE0A ;
regs.h.bl = c ;
int86(0x15,®s,®s)
#endif __TURBOC__
}
/*======================================================*/
/* DVapilevel--define the minimum API level required */
/* Ralf Brown 4/3/88 */
/*======================================================*/
void pascal DVapilevel(int level, int mod)
{
#ifdef __TURBOC__
_BL = level ;
_BH = mod ;
_AX = 0xDE0B ;
geninterrupt(0x15) ;
#else
union REGS regs ;
regs.x.ax = 0xDE0B ;
regs.h.bh = mod ;
regs.h.bl = level ;
int86(0x15,®s,®s) ;
#endif __TURBOC__
}
/*======================================================*/
/* DVpushkey--put key into keyboard input stream */
/* Ralf Brown 4/3/88 */
/*======================================================*/
WORD pascal DVpushkey(int key, int scancode)
{
#ifdef __TURBOC__
_BL = key ;
_BH = scancode ;
_AX = 0xDE10 ;
geninterrupt(0x15) ;
return _BX ; /* usually, but not always, same as BX passed in */
#else
union REGS regs ;
regs.x.ax = 0xDE10 ;
regs.h.bl = key ;
regs.h.bh = scancode ;
int86(0x15,®s,®s) ;
return regs.x.bx ;
#endif __TURBOC__
}
/*======================================================*/
/* DVjustify set whether visible part of window follows*/
/* cursor */
/* Ralf Brown 4/8/88 */
/*======================================================*/
void pascal DVjustify(int justify)
{
#ifdef __TURBOC__
_BL = justify ;
_AX = 0xDE11 ;
geninterrupt(0x15) ;
#else
union REGS regs ;
regs.x.ax = 0xDE11 ;
regs.h.bl = justify ;
int86(0x15,®s,®s) ;
#endif __TURBOC__
}
/* End of DVAPI.C */